Skip to content

fix: wallet refresh button + internal send 0 amount display#71

Merged
github-actions[bot] merged 1 commit into
mainfrom
agent/fix-required-signer-send
May 10, 2026
Merged

fix: wallet refresh button + internal send 0 amount display#71
github-actions[bot] merged 1 commit into
mainfrom
agent/fix-required-signer-send

Conversation

@Fuma419

@Fuma419 Fuma419 commented May 10, 2026

Copy link
Copy Markdown
Owner

Summary

  • Refresh button: adds a refresh icon next to the balance display; click to force-refresh wallet data (shows spinner while loading)
  • Auto-refresh on focus: visibilitychange listener refreshes wallet data when the tab regains focus (debounced 15s)
  • Internal send 0.000000 amount fix: getAddressCredentials called Address.staking_cred() which doesn't exist in CSL v15 (only BaseAddress.stake_cred()). The thrown error caused all addresses to return [null, null] credentials, so null === null matched every UTxO output — netting to ~0. Fixed by casting to BaseAddress and using stake_cred(). Also tightened matchesAnyCredential to prefer payment credential match.
  • 12 new unit tests for credential matching, calculateAmount (internal/external sends, receives), and getTxType classification

Test plan

  • Unit tests pass (NODE_ENV=test npx jest)
  • Build succeeds (npm run build:webpack)
  • Manual: refresh button visible next to balance, triggers data reload
  • Manual: switching tabs and back auto-refreshes after 15s
  • Manual: internal send (account 0 → account 1) shows correct non-zero amount in tx history

…amount

Refresh mechanism:
- Add refresh icon button next to balance display (calls getData with
  forceUpdate). Shows spinner while fetching.
- Auto-refresh on tab/window focus via visibilitychange listener,
  debounced to 15s to avoid spamming the API.

Internal send 0.000000 amount fix:
- Root cause: getAddressCredentials called Address.staking_cred()
  which doesn't exist in CSL v15 (only BaseAddress.stake_cred() does).
  The thrown error caused all addresses to return [null, null]
  credentials, making null === null match everything. Both input and
  output UTxOs were included, netting to ~0.
- Fix: cast Address to BaseAddress first, use stake_cred(). Fall back
  gracefully for RewardAddress and ByronAddress.
- matchesAnyCredential now requires payment credential match when both
  addresses have one (not OR staking). Staking cred is fallback for
  reward addresses only.
- 12 new unit tests covering credential matching, calculateAmount for
  internal/external sends and receives, and getTxType classification.
@vercel

vercel Bot commented May 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
lucem-wallet Ignored Ignored May 10, 2026 8:53pm

Request Review

@github-actions github-actions Bot enabled auto-merge (squash) May 10, 2026 20:53
@github-actions github-actions Bot merged commit b711b7d into main May 10, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant